from page.basePage import PageElement, PageObject
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from config.conf import ConfigManager


class UfmElements(PageObject):
    # 登录
    username = PageElement(xpath='/html/body/div[1]/div/div/div/div[1]/form/div[2]/div/div[1]/div/div/div/input')
    password = PageElement(xpath='/html/body/div[1]/div/div/div/div[1]/form/div[4]/div/div/div/div/div/input')
    login_button = PageElement(css='#app > div > div > div > div.tc.login-btn-box > button')
    login_success = PageElement(xpath='/html/body/div[3]/p')
    # 登出
    loginout = PageElement(xpath='/html/body/div[1]/div/section/section/header/div/ul/li/div[2]/div')
    loginout_button = PageElement(xpath='/html/body/div[2]/div[1]/div/div[1]/div/ul/li[2]/div')
    #资源
    #远程文件系统_s3
    resource = PageElement(xpath='/html/body/div[1]/div/section/aside/div[1]/ul/li[2]/div[1]')
    system = PageElement(xpath='/html/body/div[1]/div/section/aside/div[1]/ul/li[2]/div[2]/span')
    dropdown = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[1]/div/div/div/div[1]/div[2]')
    S3_Compatible_Storage = PageElement(xpath='/html/body/div[2]/div[2]/div/div/div[1]/ul/li[6]/span')
    name = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[2]/div[2]/div/div[1]/div/form/div[1]/div[2]/div/div/div/div/input')
    adress = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[2]/div[2]/div/div[1]/div/form/div[2]/div[2]/div/div/div/div/input')
    sign = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[2]/div[2]/div/div[1]/div/form/div[3]/div[2]/div/div/div/div[1]/div[2]')
    s3_name = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[2]/div[2]/div/div[1]/div/form/div[4]/div[2]/div[1]/div/div/div/input')
    s3_password = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[2]/div[2]/div/div[1]/div/form/div[5]/div[2]/div/div/div/input')
    sign_v4 = PageElement(xpath='/html/body/div[2]/div[3]/div/div/div[1]/ul/li[2]/span')
    test = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div[2]/div[3]/button[2]')
    save = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[3]/button[1]/span[2]')
    detele = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[1]/ul/li[1]/div[2]/span[1]')


    detele_sure = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[2]/div/div/div/footer/div/button[2]/span')
    detele_cancel = PageElement(xpath='/html/body/div[5]/div/div[2]/div/div[2]/div[3]/button[1]')
    # 断言提示
    prompt_system = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[2]/div/div/div/header/div/span')


    #测试成功和保存成功
    test_success = PageElement(xpath='/html/body/div[3]/p')
    save_success = PageElement(xpath='/html/body/div[4]/p')
    #文件访问失败弹窗
    access_faild = PageElement(xpath='/html/body/div[4]/div/div/div[2]/div[1]/div/div/div[1]')
    '/html/body/div[4]/p'#表单校验错误请检查地址
    #不再显示弹框
    no_display = PageElement(xpath='/html/body/div[4]/div/div/div[3]/button[1]/span')
    #保存不显示按钮
    save_faild = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div[2]/div[3]/button[1]/span[2]')

    def click_no_display(self):
        self.click_button(self.no_display)

    #远程文件系统_local
    local_file_system = PageElement(xpath='/html/body/div[2]/div[2]/div/div/div[1]/ul/li[1]/span')
    local_name = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[2]/div[2]/div/div/div/form/div[1]/div/div/div[1]/div/div/div/input')
    checkbox_1 = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[2]/div[2]/div/div/div/form/div[3]/div/div/div/label/span[2]')
    checkbox_2 = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div[2]/div[2]/div[2]/div/div/div[3]/div/label')
    Drive_letter_name_1 = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[2]/div[2]/div/div/div/form/div[3]/div/div/ul/li[1]/div[2]/div/div/div/input')
    Drive_letter_name_2 = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div[2]/div[2]/div[2]/div/div/div[3]/ul/li[2]/span[3]/input')
    Drive_letter_name_3 = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div[2]/div[2]/div[2]/div/div/div[3]/ul/li[3]/span[3]/input')
    Drive_letter_name_4 = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div[2]/div[2]/div[2]/div/div/div[3]/ul/li[4]/span[3]/input')
    Drive_letter_name_5 = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div[2]/div[2]/div[2]/div/div/div[3]/ul/li[5]/span[3]/input')
    Drive_letter_path_1 = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[2]/div[2]/div/div/div/form/div[3]/div/div/ul/li[1]/div[3]/div/div/div/input')
    Drive_letter_path_2 = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div[2]/div[2]/div[2]/div/div/div[3]/ul/li[2]/span[4]/input')
    Drive_letter_path_3 = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div[2]/div[2]/div[2]/div/div/div[3]/ul/li[3]/span[4]/input')
    Drive_letter_path_4 = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div[2]/div[2]/div[2]/div/div/div[3]/ul/li[4]/span[4]/input')
    Drive_letter_path_5 = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div[2]/div[2]/div[2]/div/div/div[3]/ul/li[5]/span[4]/input')
    local_test = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div[2]/div[3]/button[2]')
    local_save = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div[2]/div[3]/button[1]')
    local_s3_success = PageElement(xpath='/html/body/div[3]/div/div/div/div/div/span[2]')
    #新建按钮
    new = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[1]/div/button/span[2]')

    #FTP文件系统
    ftp = PageElement(xpath='/html/body/div[2]/div[2]/div/div/div[1]/ul/li[2]/span')
    ftp_name = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[2]/div[2]/div/div[1]/div/form/div[1]/div[2]/div[1]/div/div/div/input')
    ftp_host = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[2]/div[2]/div/div[1]/div/form/div[2]/div[2]/div[1]/div/div/div/input')
    ftp_port = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[2]/div[2]/div/div[1]/div/form/div[3]/div[2]/div/div/div/div/input')
    # ftp_dir = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[2]/div[2]/div/div[1]/div/form/div[4]/div[2]/div/div/div/div/input')
    ftp_username = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[2]/div[2]/div/div[1]/div/form/div[5]/div[2]/div/div/div/div/div/input')
    ftp_password = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[2]/div[2]/div/div[1]/div/form/div[6]/div[2]/div/div/div/input')
    #匿名
    ftp_anonymity = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[2]/div[2]/div/div[1]/div/form/div[5]/div[2]/div[1]/label/span[2]')
    ftp_hide_tls = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[2]/div[2]/div/div[1]/div/form/div[7]/div[2]/div/label[2]/span[2]')
    ftp_display_tls = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[2]/div[2]/div/div[1]/div/form/div[7]/div[2]/div/label[3]/span[2]')

    def click_ftp(self):
        self.click_button(self.ftp)
    def click_anonymity(self):
        self.click_button(self.ftp_anonymity)
    def click_hide_tls(self):
        self.click_button(self.ftp_hide_tls)
    def click_display_tls(self):
        self.click_button(self.ftp_display_tls)

    #NFS文件系统
    nfs = PageElement(xpath='/html/body/div[2]/div[2]/div/div/div[1]/ul/li[3]/span')
    nfs_name = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[2]/div[2]/div/div/div/form/div[1]/div[2]/div[1]/div/div/div/input')
    nfs_host = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[2]/div[2]/div/div/div/form/div[2]/div[2]/div[1]/div/div/div/input')
    nfs_sharefile = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[2]/div[2]/div/div/div/form/div[3]/div[2]/div/div/div/div/input')

    def click_nfs(self):
        self.click_button(self.nfs)

    #远程数据源
    remote = PageElement(xpath='/html/body/div[1]/div/section/aside/div[1]/ul/li[2]/div[3]')
    remote_new = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[1]/div/button/span[2]')
    data_name = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[1]/div[2]/div/div/div/form/div[1]/div[2]/div[1]/div[1]/div/div/div/input')
    host = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[1]/div[2]/div/div/div/form/div[2]/div[2]/div/div/div/div/input')
    port = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[1]/div[2]/div/div/div/form/div[3]/div[2]/div/div/div/div/input')
    data_username = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[1]/div[2]/div/div/div/form/div[4]/div[2]/div/div/div/div/input')
    data_password = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[1]/div[2]/div/div/div/form/div[5]/div[2]/div/div/div/input')
    remote_test = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[2]/button[2]/span[2]')
    remote_save = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[2]/button[1]')
    max_connect = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[2]/div[1]/div[2]/div/div/div/form/div[6]/div[2]/div/div/div/div/input')
    remote_delete = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[1]/ul/li[1]/div[2]/span[1]')
    remote_copy = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[1]/div[1]/ul/li[1]/div[2]/span[3]')
    delete_sure = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[2]/div/div/div/footer/div/button[2]/span')
    delete_cancel = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div[2]/div/div/div/footer/div/button[1]/span')
    yonghu  = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div[2]/div[2]/div[2]/div/div/div[2]/div[2]/div/div/label[2]/span[2]')
    #复制后测试

    #测试成功和保存成功                         '/html/body/div[3]/div/div/div/div/div/span[2]'
    remote_test_success = PageElement(xpath='/html/body/div[3]/p')
    remote_save_success = PageElement(xpath='/html/body/div[4]/p')

    #测试数据源失败弹窗
    fail = PageElement(xpath='/html/body/div[4]/div/div/div[2]/div[1]/div/div/div[1]')
    #不再显示弹窗
    display = '/html/body/div[4]/div/div/div[3]/button[1]/span'

    def click_display(self):
        self.click_button(self.display)



    #部署
    agent = PageElement(xpath='/html/body/div[1]/div/section/aside/div[1]/ul/li[3]/div[1]')
    agent_deployment = PageElement(xpath='/html/body/div[1]/div/section/aside/div[1]/ul/li[3]/div[3]')
    singlenode = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div/div[2]/div/div/div/div[2]/div[1]/div[2]/form/div/div[1]/div/div[2]/div/div/div/div/div/textarea')
    leftnode = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div/div[2]/div/div/div/div[2]/div[1]/div[2]/form/div/div[2]/div/div[2]/div/div/div/div[1]/div/div/div/div/input')
    rightnode = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div/div[2]/div/div/div/div[2]/div[1]/div[2]/form/div/div[2]/div/div[2]/div/div/div/div[3]/div/div/div/div/input')
    exceptnode = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div/div[2]/div/div/div/div[2]/div[2]/div[2]/form/div/div[1]/div/div[2]/div/div/div/div/div/textarea')
    singlenode_save = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div/div[2]/div/div/div/div[1]/button')
    ip = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div/div[2]/div/div/div/div[2]/div[1]/div[2]/form/div/div[1]/div/div[2]/div/div/div/div/div/textarea')
    quanxuan_button = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div/div[2]/div/div/div/div[4]/div/div/div/div/div/div[1]/div[2]/div[2]/div/div/div[1]/div[2]/table/thead/tr/th[2]/div/label/span/span')
    bulk_installtion = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div/div[2]/div/div/div/div[4]/div/div/div/div/div/div[1]/div[2]/div[1]/div[1]/span[4]/span/button')
    input_yes = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div/div[2]/div/div/div/div[4]/div/div/div/div/div/div[2]/div/div/div/div/div/div/form/div/div/div[1]/div/input')

    holistic_inspection = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div/div[2]/div/div/div/div[4]/div/div/div/div/div/div[1]/div[2]/div[1]/div[2]/button/span')
    singlenode_install = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div/div[2]/div/div/div/div[4]/div/div/div/div/div/div[1]/div[2]/div[2]/div/div/div[1]/div[3]/div/div[1]/div/table/tbody/tr/td[8]/div/span[2]/span/span')
    singlenode_install_sure = PageElement(xpath='/html/body/div[2]/div[4]/div[3]/button[2]')
    # install_success = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div/div[2]/div/div/div/div[4]/div/div/div/div/div/div[1]/div[2]/div[2]/div/div/div[1]/div[3]/div/div[1]/div/table/tbody/tr/td[7]/div/div/span/span')
    xx_button = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div/div[2]/div/div/div/div[4]/div/div/div/header/button/i')



    #测试新组件
    case_test = PageElement(xpath='/html/body/div[1]/div/section/aside/div[1]/ul/li[4]/div[1]')
    test3 = PageElement(xpath='/html/body/div[1]/div/section/aside/div[1]/ul/li[4]/div[4]')
    test3_sure = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div[2]/div/div/div/footer/div/button[2]')

    def click_case_test(self):
        self.click_button(self.case_test)
    def click_test3(self):
        self.click_button(self.test3)
    def click_test3_sure(self):
        self.click_button(self.test3_sure)

    def click_delete_cancel(self):
        self.click_button(self.delete_cancel)



    #单节点部署
    def click_agent(self):
        self.click_button(self.agent)
    def click_agent_deployment(self):
        self.click_button(self.agent_deployment)

    def click_singlenode_save(self):
        self.click_button(self.singlenode_save)

    def click_holistic_inspection(self):
        self.click_button(self.holistic_inspection)

    def click_singlenode_install(self):
        self.click_button(self.singlenode_install)

    def click_xx_button(self):
        self.click_button(self.xx_button)

    def click_singlenode_install_sure(self):
        self.click_button(self.singlenode_install_sure)

    def click_quanxuan_button(self):
        self.click_button(self.quanxuan_button)

    def click_bulk_installtion(self):
        self.click_button(self.bulk_installtion)

    #封装点击按钮方法
    def click_button(self, button):
        if isinstance(button, list):
            button[0].click()
        else:
            button.click()

        # 点击登录
    def click_login_button(self):
        self.click_button(self.login_button)

    def click_loginout_button(self):
        self.click_button(self.loginout)

    def click_exit_button(self):
        self.click_button(self.loginout_button)

    def click_resource_button(self):
        self.click_button(self.resource)

    def click_system_button(self):
        self.click_button(self.system)

    def click_dropdown_button(self):
        self.click_button(self.dropdown)

    def click_s3_button(self):
        self.click_button(self.S3_Compatible_Storage)

    def click_sign_button(self):
        self.click_button(self.sign)

    def click_sign_v4_button(self):
        self.click_button(self.sign_v4)

    def click_test_button(self):
        self.click_button(self.test)

    def click_save_button(self):
        self.click_button(self.save)

    def click_checkbox_1_button(self):
        self.click_button(self.checkbox_1)

    def click_checkbox_2_button(self):
        self.click_button(self.checkbox_2)

    def click_local_file_system_button(self):
        self.click_button(self.local_file_system)

    def click_local_save_button(self):
        self.click_button(self.local_save)

    def click_local_test_button(self):
        self.click_button(self.local_test)

    def click_new_button(self):
        self.click_button(self.new)

    def click_detele_button(self):
        self.click_button(self.detele)

    def click_detele_sure_button(self):
        self.click_button(self.detele_sure)

    #远程数据源
    def click_remote_button(self):
        self.click_button(self.remote)

    def click_remote_new_button(self):
        self.click_button(self.remote_new)

    def click_remote_test_button(self):
        self.click_button(self.remote_test)

    def click_remote_save_button(self):
        self.click_button(self.remote_save)

    def click_remote_delete_button(self):
        self.click_button(self.remote_delete)

    def click_remote_copy_button(self):
        self.click_button(self.remote_copy)

    def click_delete_button(self):
        self.click_button(self.delete_sure)





# class TaskElements(PageObject):

    #任务主页
    task = PageElement(xpath='/html/body/div[1]/div/section/aside/div[1]/ul/li[1]/div[1]')
    public_task = PageElement(xpath='/html/body/div[1]/div/section/aside/div[1]/ul/li[1]/div[2]')

    task_new = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div[1]/div[2]/div/button[1]')
    Import = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div[1]/div[2]/div/div/div/button')
    export = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div[1]/div[2]/div/span[1]/span/button')
    overall_state = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div[1]/div[2]/div/span[1]/span/button')
    start = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div[1]/div[2]/div/span[3]/span/button')
    stop = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div[1]/div[2]/div/span[2]/span/button')
    reflesh = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div[1]/div[2]/div/button[3]')

    #第一个任务ID
    id_1 = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div[2]/div/div/div/div/div[2]/table/tbody/tr[2]/td[2]')
    #选择第某个任务
    task_choose = PageElement(xpath='//*[@name="{}"]/..'.format(ConfigManager.task_name))
    task_choose_2 = PageElement(xpath='//*[@name="{}"]/..'.format(ConfigManager.task_name_2))
    task_choose_3 = PageElement(xpath='//*[@name="{}"]/..'.format(ConfigManager.task_name_3))
    #导入覆盖提示
    #提示标头，显示出来说明成功
    prompt = PageElement(xpath='/html/body/div[3]/div/div/div[1]/div/span')
    import_sure = PageElement(xpath='/html/body/div[3]/div/div/div[3]/button/span')
    status_1 = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div[1]/div[2]/div/button[2]/span[2]')
    status_2 = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div[1]/div[3]/div/div/div/header/div/span')
    status_stop = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div[1]/div[3]/div/div/div/header/button/i/svg/path')
    status_sure = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div[1]/div[3]/div/div/div/footer/div/button[2]/span')
    #批量停止
    stop_sure = PageElement(xpath='/html/body/div[2]/div[5]/div[3]/button[2]/span')
    #伺服
    sifu = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div[2]/div/div/div/div/div[2]/table/tbody/tr[2]/td[7]/span[1]/span')
    status = PageElement(xpath='/html/body/div[1]/div/section/section/main/div/div/div[2]/div/div/div/div/div[2]/table/tbody/tr[2]/td[7]/span[2]/span')


    def click_import_sure(self):
        self.click_button(self.import_sure)
    def click_status_stop(self):
        self.click_button(self.status_stop)
    def click_status_sure(self):
        self.click_button(self.status_sure)
    def click_start(self):
        self.click_button(self.start)

    def click_stop(self):
        self.click_button(self.stop)
    def click_stop_sure(self):
        self.click_button(self.stop_sure)

    def click_status_1(self):
        self.click_button(self.status_1)

    def click_prompt(self):
        self.click_button(self.prompt)

    def click_task_choose(self):
        self.click_button(self.task_choose)
    def click_task_choose_2(self):
        self.click_button(self.task_choose_2)
    def click_task_choose_3(self):
        self.click_button(self.task_choose_3)


    def click_import(self):
        self.click_button(self.Import)
    def click_export(self):
        self.click_button(self.export)



    #任务里边
    task_host = PageElement(xpath='/html/body/div[3]/div/div[2]/div/div[2]/div[2]/div[3]/ul/li[1]')
    sure = PageElement(xpath='/html/body/div[3]/div/div[2]/div/div[2]/div[3]/button[2]')
    cancel = PageElement(xpath='/html/body/div[3]/div/div[2]/div/div[2]/div[3]/button[1]')

    task_name = PageElement(xpath='/html/body/div[1]/div/div/section/section/main/div/div/div[1]/form/div[1]/div/div/div/div/div/input')
    matedata_space = PageElement(xpath='/html/body/div[1]/div/div/section/section/main/div/div/div[1]/form/div[4]/div/div/div/div')
    metaspace = PageElement(xpath='/html/body/div[2]/div[3]/div/div/div[1]/ul/li[1]')



    def click_matedata_space(self):
        self.click_button(self.matedata_space)
    def click_metaspace(self):
        self.click_button(self.metaspace)
    def click_add(self):
        self.click_button(self.add_map)
    def click_clean(self):
        self.click_button(self.clean_map)



    def click_task_host(self):
        self.click_button(self.task_host)

    def click_sure(self):
        self.click_button(self.sure)

    #映射配置
    clean_map = PageElement(xpath='/html/body/div[1]/div/div/section/section/main/div/div/div[2]/div[1]/div/div[2]/div[1]/div[1]/button[2]')
    add_map = PageElement(xpath='/html/body/div[1]/div/div/section/section/main/div/div/div[2]/div[1]/div/div[2]/div[1]/div[1]/button[1]')

    left_conn = PageElement(xpath='/html/body/div[1]/div/div/section/section/main/div/div/div[2]/div[1]/div/div[2]/div[1]/div[2]/div/div/div/div/div[2]/table/tbody/tr[2]/td[2]/div/div[1]/div[2]/div/div/div/div/div')
    left_conn_1 = PageElement(xpath='/html/body/div[2]/div[8]/div/div/div[1]/ul/li[1]')
    left_space = PageElement(xpath='/html/body/div[1]/div/div/section/section/main/div/div/div[2]/div[1]/div/div[2]/div[1]/div[2]/div/div/div/div/div[2]/table/tbody/tr[2]/td[2]/div/div[2]/div[2]/div/div/div/div/div[1]/div[2]')
    left_space_1 = PageElement(xpath='/html/body/div[2]/div[8]/div/div/div[1]/ul/li[1]/span/span')

    right_conn = PageElement(xpath='/html/body/div[1]/div/div/section/section/main/div/div/div[2]/div[1]/div/div[2]/div[1]/div[2]/div/div/div/div/div[2]/table/tbody/tr[2]/td[4]/div/div[1]/div[2]/div/div/div/div/div')
    right_sapce = PageElement(xpath='/html/body/div[1]/div/div/section/section/main/div/div/div[2]/div[1]/div/div[2]/div[1]/div[2]/div/div/div/div/div[2]/table/tbody/tr[2]/td[4]/div/div[2]/div[2]/div/div/div/div/div[1]/div[2]')
    right_conn_1 = PageElement(xpath='/html/body/div[2]/div[9]/div/div/div[1]/ul/li[2]')
    right_sapce_1 = PageElement(xpath='/html/body/div[2]/div[8]/div/div/div[1]/ul/li[2]/span/span')

    #迁移配置
    migrate = PageElement(xpath='/html/body/div[1]/div/div/section/section/main/div/div/div[2]/div[1]/div/div[1]/div/div/div/div[3]')

    #复制配置
    copy_1 = PageElement(xpath='/html/body/div[1]/div/div/section/section/main/div/div/div[2]/div[1]/div/div[2]/div[2]/div/form/div[1]/div[1]/div/div[1]/div[2]/div/div/div/div')

    #缓冲配置
    #工作线程配置
    #一体化加速
    #删除配置
    #分片传输

    task_save = PageElement(xpath='/html/body/div[1]/div/div/section/section/main/div/div/div[1]/button/span')



    def click_task(self):
        self.click_button(self.task)

    def click_public(self):
        self.click_button(self.public_task)

    def click_refresh(self):
        self.click_button(self.reflesh)